home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / bash_completion.d / brctl < prev    next >
Encoding:
Text File  |  2010-11-16  |  1.1 KB  |  49 lines

  1. # bash completion for brctl
  2.  
  3. have brctl &&
  4. _brctl()
  5. {
  6.     local cur command
  7.  
  8.     COMPREPLY=()
  9.     _get_comp_words_by_ref cur
  10.     command=${COMP_WORDS[1]}
  11.  
  12.     case $COMP_CWORD in
  13.         1)
  14.             COMPREPLY=( $( compgen -W "addbr delbr addif delif \
  15.                 setageing setbridgeprio setfd sethello \
  16.                 setmaxage setpathcost setportprio show \
  17.                 showmacs showstp stp" -- "$cur" ) )
  18.             ;;
  19.         2)
  20.             case $command in
  21.                 show)
  22.                     ;;
  23.                 *)
  24.                     COMPREPLY=( $( compgen -W "$(brctl show | \
  25.                         awk 'NR>1 {print $1}' )" -- "$cur" ) )
  26.             esac
  27.             ;;
  28.         3)
  29.             case $command in
  30.                 addif|delif)
  31.                     _configured_interfaces
  32.                     ;;
  33.                 stp)
  34.                     COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) )
  35.                     ;;
  36.             esac
  37.             ;;
  38.     esac
  39. } &&
  40. complete -F _brctl -o default brctl
  41.  
  42. # Local variables:
  43. # mode: shell-script
  44. # sh-basic-offset: 4
  45. # sh-indent-comment: t
  46. # indent-tabs-mode: nil
  47. # End:
  48. # ex: ts=4 sw=4 et filetype=sh
  49.